<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>

<body>
    <div id='app'>
        <input type="text" name="value" id="value" v-model="keywords">
        <button @click="search">搜索</button>
        <button @click="changeData">修改数据</button>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                keywords: ""
            },
            methods: {
                search() {
                    // 获取用户输入的值，进行接口调用
                    // console.log(document.getElementById('value').value); 
                    console.log(this.keywords);
                },
                changeData() {
                    // 1. 数据驱动
                    // 2. 响应式
                    this.keywords = "**" + this.keywords + "**"
                }
            },
        })
    </script>
</body>

</html>